//
//  MainGuideViewController.swift
//  Drop
//
//  Created by hushaohua on 2019/2/1.
//  Copyright © 2019 init. All rights reserved.
//

import UIKit

class MainGuideViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor.white;
        self.view.addSubview(self.textLabel);
        self.view.addSubview(self.startButton);
    }
    
    lazy var textLabel:UILabel = {
        var label = UILabel(frame: CGRect(x: 15, y: 120, width: self.view.bounds.size.width - 30, height: 200));
        label.text = "    Drop是一个记录刚刚过去时间的应用。\n    为了督促你记录过去的时间，应用需要你开启通知，每过一段时间通知你应该记录了。\n    如果你已经养成了及时记录时间的习惯，您可以在 \"统计\"->\"设置\"中开启\"静默模式\"";
        label.textAlignment = .left;
        label.textColor = UIColor.black;
        label.numberOfLines = 0;
        label.font = UIFont.systemFont(ofSize: 16);
        return label;
    }();
    
    lazy var startButton:UIButton = {
        var button = UIButton(frame: CGRect(x: 80, y: 360, width: self.view.bounds.size.width - 160, height: 40));
        button.backgroundColor = UIColor.black;
        button.setTitleColor(UIColor.white, for: .normal);
        button.setTitle("Start", for: .normal);
        button.addTarget(self, action: #selector(startButtonClicked(_:)), for: .touchUpInside);
        return button;
    }();
    
    var startClosure:(() -> Void)?;
    @objc func startButtonClicked(_ sender:UIButton) {
        if self.startClosure != nil {
            self.startClosure!();
        }
    }

}
